﻿//init.js

    var bikeFindr = {
  
    //init angular module
    module: angular.module("bikeFindr",[]),
    
    init: function() {
        //init bootstrap js features
        var tooltipOptions = {
            placement: 'top',
            container: 'body',
            html: true,
            selector: 'button.btn-with-tooltip'
        };

        $('body').tooltip(tooltipOptions);
        
        //init fancybox plugin
        $(document).ready(function () {
            $('.fancybox').fancybox(

            ).trigger('click');
        });
      
    }
};
     
    bikeFindr.module.config(function ($routeProvider) {

        $routeProvider.when("/", {
            controller: "bikesController",
            templateUrl: '/Templates/SearchBikes.html'
        });

        $routeProvider.when("/contact", {
            controller: "bikesController",
            templateUrl: '/Templates/Contact.html'
        });

        $routeProvider.when("/advancedSearch", {
            controller: "bikesController",
            templateUrl: '/Templates/SearchBikesAdvanced.html'
        });
        
        $routeProvider.when("/terms", {
            controller: "bikesController",
            templateUrl: '/Templates/TermsOfUse.html'
        });

        $routeProvider.otherwise({ redirectTo: "/" });
    });

    bikeFindr.module.filter('range', function() {
        return function(input, total) {
            total = parseInt(total);
            for (var i=0; i<total; i++)
                input.push(i);
            return input;
        };
    });

    bikeFindr.init();


